package com.hunk.springMvcExercise.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author HunkDeng
 * 
 */
@Controller
@RequestMapping("/freemarker")
public class FreeMarkerController {
	@RequestMapping(value = "/welcome", method =RequestMethod.GET)
	public ModelAndView getFirstPage(HttpServletRequest request) {
		// welcom就是视图的名称（welcom.ftl）
		ModelAndView mv = new ModelAndView("test");
		mv.addObject("name", "My First Spring Mvc");
		return mv;	
	}
}
